from django.urls import path
# from rest_framework_jwt.views import obtain_jwt_token
from apps.admin.views.user import meiduo_token
from apps.admin.views.counts import DailyActiveUsersCountView,\
    DailyOrderUsersCountView,MonthIncrementUsersCountView,UserCountView,\
    DailyIncrementUsersCountView
from apps.admin.views.user import UserAPIView
from apps.admin.views.images import ImageModelViewSet,ImageSKUAPIView
from apps.admin.views.sku import SKUModelViewSet,GoodsCategoryAPIView,GoodsSimpleView,\
    SPUSpecAPIView


urlpatterns = [
    # path('meiduo_admin/authorizations/', obtain_jwt_token),
    path('meiduo_admin/authorizations/', meiduo_token),
    #日活
    path('meiduo_admin/statistical/day_active/', DailyActiveUsersCountView.as_view()),
    #日下单
    path('meiduo_admin/statistical/day_orders/', DailyOrderUsersCountView.as_view()),
    #月增
    path('meiduo_admin/statistical/month_increment/', MonthIncrementUsersCountView.as_view()),
    #用户总数
    path('meiduo_admin/statistical/total_count/', UserCountView.as_view()),
    #日增
    path('meiduo_admin/statistical/day_increment/', DailyIncrementUsersCountView.as_view()),
    #user
    path('meiduo_admin/users/', UserAPIView.as_view()),
    #图片新增展示
    path('meiduo_admin/skus/simple/', ImageSKUAPIView.as_view()),
    #三级视图获取
    path('meiduo_admin/skus/categories/', GoodsCategoryAPIView.as_view()),
    #获取SPU
    path('meiduo_admin/goods/simple/', GoodsSimpleView.as_view()),
    #sku中获取spu的规格,选项
    path('meiduo_admin/goods/<spu_id>/specs/', SPUSpecAPIView.as_view()),
    #

]

from rest_framework.routers import DefaultRouter
router = DefaultRouter()
router.register('meiduo_admin/skus/images',ImageModelViewSet,basename='image')
#商品图片展示

#####   SKU     #####
router.register('meiduo_admin/skus',SKUModelViewSet,basename='skus')
urlpatterns+=router.urls





